﻿CREATE proc capmenu_loadgridchuongtrinh
@MaNhom int
as
select cast(0 as bit) as Chon,a.MaChuongTrinh,a.TenChuongTrinh,b.DienGiai from DanhMuc_ChuongTrinh a,DanhMuc_NhomChuongTrinh b
Where a.NhomCT=b.NhomCT and a.MaChuongTrinh not in (select MaChuongTrinh from QuanTri_CapQuyenNguoiDungSuDungMenu Where MaNhomUser=@MaNhom)
union
select cast(1 as bit) as Chon,a.MaChuongTrinh,a.TenChuongTrinh,b.DienGiai from DanhMuc_ChuongTrinh a,DanhMuc_NhomChuongTrinh b
Where a.NhomCT=b.NhomCT and a.MaChuongTrinh in (select MaChuongTrinh from QuanTri_CapQuyenNguoiDungSuDungMenu Where MaNhomUser=@MaNhom)